package com.medreams.service.impl;

import com.medreams.dao.TestDao;
import com.medreams.domain.Test;
import com.medreams.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service(value = "testServiceImpl")
public class TestServiceImpl implements TestService {

    @Autowired
    private TestDao testDao;

    @Override
    public List<Test> findAll() {
        List<Test> list = testDao.getList();
        return list;
    }

    public Integer insertTest(){
        Test test = new Test();
        test.setUser_name("ceshi");
        test.setCreate_time(System.currentTimeMillis()/1000);
        Integer integer = testDao.addTest(test);
        return integer;
    }
}
